<?php include PATH_TPL."/admin/tpl.header.phtml"?>
<div class="main-container inner">
    <div class="main-content">
        <div class="container-fluid">
            <div class="row bt">
                <div class="col-lg-12 bg">
                    <ol class="breadcrumb">
                        <li class="active">
                            <i class="fa  fa-fw fa-reorder"></i>审核详情
                        </li>
                    </ol>
                </div>
            </div>
            <div id="page-wrapper">
                <div class="container-fluid col-md-12 col-sx-12">
                <a class="btn btn-green btn-xs tooltips" id="download" href="#" data-original-title="下载"><i class="fa fa-cloud-download"></i></a>
                     <form name='myform'>
                        <div class="form-group ">
                            <label><strong>姓名</strong></label></br>
                            <label><?=$tUCRow['username']?></label>
                        </div>
                        <div class="form-group ">
                            <label><strong>证件类型</strong></label></br>
                            <label><?=$tURow['crittype_info']?></label>
                        </div>
                         <div class="form-group ">
                            <label><strong>证件号码</strong></label></br>
                            <label><?=$tURow['critcode']?></label>
                        </div>
                        <!-- <div class="form-group ">
                            <label><strong>保险公司</strong></label></br>
                            <label><?=$tUCRow['insurance_name']?></label>
                        </div>-->
                         <div class="form-group ">
                            <label><strong>投保单位</strong></label></br>
                            <label><?=$tUCRow['policyname']?></label>
                        </div>
                         <div class="form-group ">
                            <label><strong>属组</strong></label></br>
                            <label><?=$tUCRow['policygroupremak']?></label>
                        </div>
                        <div class="form-group">
                            <label><strong>保单号</strong></label></br>
                            <label><?=$tUCRow['policyno']?></label>
                        </div>
                        <div class="form-group">
                            <label><strong>申请时间</strong></label></br>
                            <label><?=date('Y,m,d H:i',$tUCRow['created'])?></label>
                        </div>
                         <div class="form-group ">
                            <label><strong>赔付状态</strong></label></br>
                            <label><?php echo $tStatusRow[$tUCRow['status']];
                                if($tUCRow['status'] == 4){
                                switch($tUCRow['is_dishonor']){
                                    case 1:echo '(已付)';break;
                                    case 2:echo '(拒付)';break;}
                                } 
                            echo '</br>';
							foreach($tUCRow['introduce'] as $tK=>$tV){
								echo $tUCRow['introduce'][$tK]['introduce'].'</br>';
							}
							/*switch($tUCRow['status']){
    case 2: echo '您病例缺失，补充后请重新提交';break;
                            }*/
                               
                            ?></label>
                        </div>
                         <div class="form-group ">
                            <label><strong>审核来源</strong></label></br>
                            <label><?if($tUCRow['sourceflag'] == '0'){echo '线上';}elseif($tUCRow['sourceflag'] == '1'){echo '线下';}?></label>
                        </div>
                        <div class="form-group <?if($tUCRow['status'] == 1 || $tUCRow['status'] == 2 || $tUCRow['status'] == 0){echo 'hidden';}?>">
                            <label><strong>报销结果</strong></label></br>
                            <label id="result">你在<?=date('Y年m月d号 ',$tUCRow['created'])?>申请的报销，您本次申请的医药费发生额共计<?=$tfCount?>元，医疗票据<?=$tCTCCount?>张，其中社保已支付<?=$tsCount?>元。您本次通过企业补充医疗保险报销<?=$tqCount?>元，医疗基金报销<?=$tyCount?>元，合计总报销<?=($tqCount+$tyCount)?>元</label>
                        </div>
                        <div class="form-group <?if($tUCRow['status'] == 1 || $tUCRow['status'] == 2 || $tUCRow['status'] == 0 ||empty($tqCTCDatas)){echo 'hidden';}?>">
                            <label><strong>补充医疗保险明细 </strong></label></br>
                            <table class="table table-bordered">
                               <thead>
                                    <tr>
                                        <th>报销项目</th>
                                        <th>发生额</th>
                                        <th>社保金额</th>
                                        <th>部分自费</th>
                                        <th>审核未通过</th>
                                        <th>纯自费</th>
                                        <th>可理赔金额</th>
                                        <th>免赔额</th>
                                        <th>赔付比例</th>
                                        <th>报销金额</th>
                                    </tr>
                                </thead> 
                                <tbody>
                                <?foreach($tqCTCDatas as $tRow){?>
                                    <tr>
                                    <td><?=$tRow['DUTYTYPE']?></td>
                                    <td><?=$tRow['TOTALAMNT']?></td>
                                    <td><?=$tRow['SOCIALAMNT']?></td>
                                    <td><?=$tRow['SELFPAYAMNT']?></td>
                                    <td><?=$tRow['NONPAYAMNT']?></td>
                                    <td><?=$tRow['OWNAMNT']?></td>
                                    <td><?=$tRow['CANPAYAMNT']?></td>
                                    <td><?=$tRow['Deductibleamnt']?></td>
                                    <td><?=$tRow['PAYRATIO']?></td>
                                    <td><?=$tRow['PAYAMNT']?></td>
                                    </tr>
                                <?}?>
                                </tbody>
                            </table> 
                        </div>
                        <div class="form-group <?if($tUCRow['status'] == 1 || $tUCRow['status'] == 2 || $tUCRow['status'] == 0 || empty($tyCTCDatas)){echo 'hidden';}?>">
                            <label><strong>医疗基金报销明细 </strong></label></br>
                            <table class="table table-bordered">
                               <thead>
                                    <tr>
                                        <th>报销项目</th>
                                        <th>发生额</th>
                                        <th>赔付比例</th>
                                        <th>报销金额</th>
                                    </tr>
                                </thead> 
                                <tbody>
                                <?foreach($tyCTCDatas as $tRow){?>
                                    <tr>
                                    <td><?=$tRow['DUTYTYPE']?></td>
                                    <td><?=$tRow['TOTALAMNT']?></td>
                                    <td><?=$tRow['PAYRATIO']?></td>
                                    <td><?=$tRow['PAYAMNT']?></td>
                                    </tr>
                                <?}?>
                                </tbody>
                            </table> 
                        </div>
                        <div class="form-group <?if($tUCRow['status'] == 1||$tUCRow['status'] == 2 || $tUCRow['status'] == 0 || empty($tCTCNDatas)){echo 'hidden';}?> <?if(empty($tCTCNDatas[0]['BILLTYPE']) && empty($tCTCNDatas[0]['BILLReceiptNo']) && empty($tCTCNDatas[0]['hospitalname']) && empty($tCTCNDatas[0]['billbegindate']) && empty($tCTCNDatas[0]['totalamnt']) && empty($tCTCNDatas[0]['deductreason']) && empty($tCTCNDatas[0]['deductamnt']) && empty($tCTCNDatas[0]['deductreasonremark'])){echo 'hidden';}?>">
                            <label><strong>个人未予支付清单</strong></label></br>
                            <table class="table table-bordered">
                               <thead>
                                    <tr>
                                    <th <?if(empty($tCTCNDatas[0]['BILLTYPE'])){echo 'hidden';}?>>收据类型</th>
                                    <th <?if(empty($tCTCNDatas[0]['BILLReceiptNo'])){echo 'hidden';}?>>收据号</th>
                                    <th <?if(empty($tCTCNDatas[0]['hospitalname'])){echo 'hidden';}?>>医院名称</th>
                                    <th <?if(empty($tCTCNDatas[0]['billbegindate'])){echo 'hidden';}?>>收据日期</th>
                                    <th <?if(empty($tCTCNDatas[0]['totalamnt'])){echo 'hidden';}?>>账单发生额</th>
                                    <th <?if(empty($tCTCNDatas[0]['deductreason'])){echo 'hidden';}?>>扣除原因</th>
                                    <th <?if(empty($tCTCNDatas[0]['deductamnt'])){echo 'hidden';}?>>扣除金额</th>
                                    <th <?if(empty($tCTCNDatas[0]['deductreasonreremark'])){echo 'hidden';}?>>扣除原因描述</th>
                                    </tr>
                                </thead> 
                                <tbody>
                                <?foreach($tCTCNDatas as $tRow){?>
                                    <tr>
                                    <td><?=$tRow['BILLTYPE']?></td>
                                    <td><?=$tRow['BILLReceiptNo']?></td>
                                    <td><?=$tRow['hospitalname']?></td>
                                    <td><?=$tRow['billbegindate']?></td>
                                    <td><?=$tRow['totalamnt']?></td>
                                    <td><?=$tRow['deductreason']?></td>
                                    <td><?=$tRow['deductamnt']?></td>
                                    <td><?=$tRow['deductreasonremark']?></td>
                                    </tr>
                                <?}?>
                                </tbody>
                            </table> 
                        </div>

                        <div class="form-group">
                            <label for="img"><strong>提交资料</strong></label>
                        </div>
                        <div>
                            <?foreach($tDataTypeList as $tKey => $tDatas){
?>
                                <div>
                                    <label><?=$tDataTypeRow[$tKey]?></label>
                                        <div class="row">
                                        <?foreach($tDatas as $tRow){?>
                                        <div class="col-md-2" style="position:relative" class="imgDiv">
                                            <a class="thumbnail">
                                            <img data-original="<?=$tRow['img']?>" src="<?=$tRow['img_small']?>" alt="...">
                                            <!-- <button type="button" class="btn btn-success" style="margin-left:27%;height:20px;width:100px;font-size:12px;line-height:10px;margin-top:5px;" id="big">点击查看大图</button> -->
                                            </a>
                                            <span aria-hidden="true" class="glyphicon glyphicon-ok icon" style="position:absolute;color:red;font-size:30px;display:none"></span>
                                            <input type="hidden" value="0" name="imgurl[<?=$tKey?>][<?=$tRow['dt_id']?>]"  />
                                        </div>
                                        <?}?>
                                    </div>
                                </div>
                            <?}?>
                        </div>
                        <div class="form-group">
                            
                            <label><strong>状态时间</strong></label></br>
                            <table>
                                <tbody>
                                <?foreach($tUCLDatas as $tRow){?>
                                    <tr>
                                    <td><?=$tRow['title']?></td>
                                    <td><?=date('Y.m.d H:i',$tRow['created'])?></td>
                                    </tr>
                                <?}?>
                                </tbody>
                            </table> 
                       </div>
                        <input type="hidden" name="case_id" value="<?=$tCaseID?>" /> 
                    </form>
                </div>
                <div class="container-fluid col-md-5">
                    <div class="images text-center" id="img_view">
                    </div>
                </div>
            </div>
        </div>
        <div class="subviews">
            <div class="subviews-container"></div>
        </div>
    </div>
    <!-- end: PAGE -->
</div>

<script>
$(function(){
    $('.row').viewer({
        url:'data-original',
    });
    $('img').mouseover(function() {
        $(this).css('cursor','pointer');
//        $(this).siblings('span[name="big"]').removeClass('hidden');
    }).mouseout(function() {
 //       $('span[name="big"]').addClass('hidden');
    });
})
		/*获取地址栏参数*/
		function GetQuery(key) {
			var search = location.search.slice(1); //得到get方式提交的查询字符串
			var arr = search.split("&");
			for (var i = 0; i < arr.length; i++) {
                var ar = arr[i].split("=");
                if (ar[0] == key) {
                        return ar[1];
                }
			}
		}
$('#download').click(function(){
	$(this).attr('href','/admin_qycase/download?case_id='+GetQuery('case_id'));
});
</script>

<?php include PATH_TPL."/admin/tpl.footer.phtml"?>
